home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume7 / xcal / patch1 < prev    next >
Encoding:
Text File  |  1990-05-06  |  12.4 KB  |  445 lines

  1. Path: tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!amdcad.amd.com!sun!hillside.co.uk
  2. From: pc@hillside.co.uk (Peter Collinson)
  3. Newsgroups: comp.sources.x
  4. Subject: v07i028: xcal, Patch1, Part01/01
  5. Message-ID: <135269@sun.Eng.Sun.COM>
  6. Date: 6 May 90 18:23:42 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 434
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: Peter Collinson <pc@hillside.co.uk>
  12. Posting-number: Volume 7, Issue 28
  13. Archive-name: xcal/patch1
  14. Patch-To: xcal: Volume 7, Issue 1-2
  15.  
  16. Xcal is a calendar program. It generally sits on your screen
  17. displaying today's date - the format of this can be tailored to your
  18. taste.
  19.  
  20. The diffs below are the result of various people getting back to me
  21. with typos, fixes and request for changes to xcal. For details see the
  22. CHANGES file which is created by this posting.
  23.  
  24. Thanks to all of you who responded.
  25.  
  26. PS. Potential unpackers of the orginal postings should change the line:
  27.  
  28.     cat "#define PATCHLEVEL 0" > patchlevel.h
  29. to
  30.     echo "#define PATCHLEVEL 0" > patchlevel.h
  31.  
  32. ------------------------- patch from here --------------
  33. Prereq: 0
  34. *** patchlevel.h~    Sat May  5 16:37:37 1990
  35. --- patchlevel.h    Sat May  5 16:16:25 1990
  36. ***************
  37. *** 1 ****
  38. ! #define PATCHLEVEL 0
  39. --- 1 ----
  40. ! #define PATCHLEVEL 1
  41. *** version.c~    Sat May  5 16:20:29 1990
  42. --- version.c    Sat May  5 16:36:59 1990
  43. ***************
  44. *** 1,10 ****
  45.   #ifndef lint
  46. ! static char *sccsid = "@(#)version.c    1.1 (Hillside Systems) 4/28/90";
  47.   #endif  lint
  48.   /*
  49.    *    Version control file
  50. !  *    version.c    1.1    4/28/90
  51. !  *    Automatically created on Sat Apr 28 17:09:34 BST 1990
  52.    *    
  53.    *    Hand edit none of this if you want freeze to continue to work
  54.    */
  55. --- 1,10 ----
  56.   #ifndef lint
  57. ! static char *sccsid = "@(#)version.c    1.2 (Hillside Systems) 5/5/90";
  58.   #endif  lint
  59.   /*
  60.    *    Version control file
  61. !  *    version.c    1.2    5/5/90
  62. !  *    Automatically created on Sat May  5 16:15:20 BST 1990
  63.    *    
  64.    *    Hand edit none of this if you want freeze to continue to work
  65.    */
  66. ***************
  67. *** 12,35 ****
  68.   #define    PROGNAME    XCal
  69.   #endif
  70.   #ifdef    VER_VEC
  71. ! char    version[] = "XCal Version 1.1, released Sat Apr 28 17:09:34 BST 1990";
  72.   #endif
  73.   #ifdef    VER_DEF
  74. ! #define    VERSION    "XCal Version 1.1, released Sat Apr 28 17:09:34 BST 1990"
  75.   #endif
  76.   
  77.   /*    SCCS files
  78.    *
  79.   +1.5    Makefile
  80. ! +3.2    xcal.c
  81. ! +1.3    xcal.man
  82. ! +3.1    xcal.h
  83.   +3.1    xcal_popup.c
  84. ! +3.3    xcal_strip.c
  85.   +3.2    xcal_help.c
  86. ! +3.1    xcal_edit.c
  87. ! +1.2    XCal.ad
  88.   +1.2    Imakefile
  89.   +1.1    README
  90.    *
  91.    */
  92. --- 12,37 ----
  93.   #define    PROGNAME    XCal
  94.   #endif
  95.   #ifdef    VER_VEC
  96. ! char    version[] = "XCal Version 1.2, released Sat May  5 16:15:20 BST 1990";
  97.   #endif
  98.   #ifdef    VER_DEF
  99. ! #define    VERSION    "XCal Version 1.2, released Sat May  5 16:15:20 BST 1990"
  100.   #endif
  101.   
  102.   /*    SCCS files
  103.    *
  104.   +1.5    Makefile
  105. ! +3.3    xcal.c
  106. ! +1.5    xcal.man
  107. ! +3.2    xcal.h
  108.   +3.1    xcal_popup.c
  109. ! +3.4    xcal_strip.c
  110.   +3.2    xcal_help.c
  111. ! +3.3    xcal_edit.c
  112. ! +1.4    XCal.ad
  113.   +1.2    Imakefile
  114.   +1.1    README
  115. + +1.4    CHANGES
  116. + +1.2    patchlevel.h
  117.    *
  118.    */
  119. *** XCal.ad~    Sat May  5 16:28:47 1990
  120. --- XCal.ad    Sat May  5 16:15:30 1990
  121. ***************
  122. *** 1,8 ****
  123.   XCal*Font: lucidasanstypewriter-12
  124.   XCal*info.Font: lucidasans-10
  125.   XCal.fontToday: lucidasanstypewriter-12
  126. ! XCal.MarkForeground: Black
  127. ! XCal.MarkBackground: White
  128.   XCal.edit.geometry: 300x150
  129.   XCal*text.scrollVertical: WhenNeeded
  130.   XCal*text.scrollHorizontal: WhenNeeded
  131. --- 1,9 ----
  132.   XCal*Font: lucidasanstypewriter-12
  133.   XCal*info.Font: lucidasans-10
  134.   XCal.fontToday: lucidasanstypewriter-12
  135. ! ! See below
  136. ! !XCal.MarkForeground: Black
  137. ! !XCal.MarkBackground: White
  138.   XCal.edit.geometry: 300x150
  139.   XCal*text.scrollVertical: WhenNeeded
  140.   XCal*text.scrollHorizontal: WhenNeeded
  141. ***************
  142. *** 29,31 ****
  143. --- 30,54 ----
  144.   XCal*check.yes.Label: yes
  145.   XCal*check.no.Label: no
  146.   XCal*help*helpQuit.Label: quit
  147. + !
  148. + ! Colours from reed wade@cs.utk.edu
  149. + !
  150. + XCal*background:        LightSteelBlue
  151. + XCal*foreground:        SaddleBrown
  152. + XCal.MarkForeground: Black
  153. + XCal.MarkBackground: CornflowerBlue
  154. + XCal.edit.background: CornflowerBlue
  155. + XCal.edit.foreground: OliveGreen
  156. + XCal*exit.background: MediumTurquoise
  157. + XCal*exit.foreground: SlateGrey
  158. + XCal*check.background:  lavender
  159. + XCal*help*background: wheat
  160. + XCal*help*foreground: blue
  161. + XCal*newdate*background: plum
  162. + XCal*newdate*foreground: red
  163. + XCal*quit.background:   SteelBlue
  164. + XCal*quit.background:   green
  165. + XCal*back.background: yellow
  166. + XCal*next.background: yellow
  167. + XCal*no.background: DarkKhaki
  168. + XCal*yes.background: PapayaWhip
  169. *** xcal.c~    Sat May  5 16:22:46 1990
  170. --- xcal.c    Sat May  5 16:15:25 1990
  171. ***************
  172. *** 1,5 ****
  173.   #ifndef lint
  174. ! static char *sccsid = "@(#)xcal.c    3.2 (Hillside Systems) 12/19/89";
  175.   static char *copyright = "@(#)Copyright 1989 Peter Collinson, Hillside Systems";
  176.   #endif  lint
  177.   /***
  178. --- 1,5 ----
  179.   #ifndef lint
  180. ! static char *sccsid = "@(#)xcal.c    3.3 (Hillside Systems) 5/2/90";
  181.   static char *copyright = "@(#)Copyright 1989 Peter Collinson, Hillside Systems";
  182.   #endif  lint
  183.   /***
  184. ***************
  185. *** 99,104 ****
  186. --- 99,106 ----
  187.       offset(textbufsz), XtRString, "2048"},
  188.   {"useWmTitle", "UseWmTitle", XtRBoolean, sizeof(Boolean),
  189.       offset(useWmTitle), XtRString, "True"},
  190. + {"minStripWidth", "MinStripWidth", XtRDimension, sizeof(Dimension),
  191. +     offset(minstripwidth), XtRString, "0"},
  192.   {"january", "January", XtRString, sizeof(String),
  193.       offset(mon[0]), XtRString, "January"},
  194.   {"february", "February", XtRString, sizeof(String),
  195. *** xcal.h~    Sat May  5 16:25:06 1990
  196. --- xcal.h    Sat May  5 16:15:26 1990
  197. ***************
  198. *** 1,5 ****
  199.   /*
  200. !  *    xcal.h    3.1    12/10/89
  201.    *
  202.    *    Header file for the xcal program
  203.    */
  204. --- 1,5 ----
  205.   /*
  206. !  *    xcal.h    3.2    5/2/90
  207.    *
  208.    *    Header file for the xcal program
  209.    */
  210. ***************
  211. *** 56,61 ****
  212. --- 56,62 ----
  213.       String    directory;    /* Directory under home where Calendar files */
  214.                   /* can be found */
  215.       int    textbufsz;    /* Text buffer size for editing */
  216. +     Dimension minstripwidth; /* Minimum strip width */
  217.   };
  218.   
  219.   extern    struct resources    appResources;
  220. *** xcal.man~    Sat May  5 16:24:13 1990
  221. --- xcal.man    Sat May  5 16:15:25 1990
  222. ***************
  223. *** 173,182 ****
  224.   If True enables accelerated time.
  225.   Default: False.
  226.   .TP
  227. - .B ReverseVideoMark
  228. - If True entries are marked (highlighted) in reverse video.
  229. - Defaults True for monochrome displays and False for colour displays.
  230. - .TP
  231.   .B MarkBackground
  232.   The background colour for highlighting entries.
  233.   Default Black.
  234. --- 173,178 ----
  235. ***************
  236. *** 221,226 ****
  237. --- 217,229 ----
  238.   This information is duplicated if your window manager uses titles
  239.   so it is nice to be able to turn it off.
  240.   Default: True.
  241. + .TP
  242. + .B MinStripWidth
  243. + The width of month strips are set by the top line, which usually
  244. + displays the month and year.
  245. + The whole strip can be widened from this default value by setting this
  246. + resource to be non-zero.
  247. + Default: zero (i.e. off).
  248.   .TP
  249.   .B TextBufferSize
  250.   the maximum number of bytes which we are prepared to deal with in an
  251. *** xcal_edit.c~    Sat May  5 16:27:54 1990
  252. --- xcal_edit.c    Sat May  5 16:15:29 1990
  253. ***************
  254. *** 1,5 ****
  255.   #ifndef lint
  256. ! static char *sccsid = "@(#)xcal_edit.c    3.1 (Hillside Systems) 12/10/89";
  257.   static char *copyright = "@(#)Copyright 1989 Peter Collinson, Hillside Systems";
  258.   #endif  lint
  259.   /***
  260. --- 1,5 ----
  261.   #ifndef lint
  262. ! static char *sccsid = "@(#)xcal_edit.c    3.3 (Hillside Systems) 5/2/90";
  263.   static char *copyright = "@(#)Copyright 1989 Peter Collinson, Hillside Systems";
  264.   #endif  lint
  265.   /***
  266. ***************
  267. *** 458,464 ****
  268.               return(False);
  269.           }
  270.           if (chdir(MapStem) < 0)
  271. !         {    XBell(XtDisplay(toplevel, 0));
  272.               fprintf(stderr, "xcal: Could not chdir into %s.\n", MapStem);
  273.               perror("xcal: chdir");
  274.               fflush(stderr);
  275. --- 458,464 ----
  276.               return(False);
  277.           }
  278.           if (chdir(MapStem) < 0)
  279. !         {    XBell(XtDisplay(toplevel), 0);
  280.               fprintf(stderr, "xcal: Could not chdir into %s.\n", MapStem);
  281.               perror("xcal: chdir");
  282.               fflush(stderr);
  283. ***************
  284. *** 480,486 ****
  285.   
  286.           if (access(fname, F_OK) < 0)
  287.           {    if (mkdir(fname, 0700) < 0)
  288. !             {    XBell(XtDisplay(toplevel, 0));
  289.                   fprintf(stderr, "xcal: Could not create: %s/%s directory.\n", MapStem, fname);
  290.                   perror("xcal: mkdir ");
  291.                   fflush(stderr);
  292. --- 480,486 ----
  293.   
  294.           if (access(fname, F_OK) < 0)
  295.           {    if (mkdir(fname, 0700) < 0)
  296. !             {    XBell(XtDisplay(toplevel), 0);
  297.                   fprintf(stderr, "xcal: Could not create: %s/%s directory.\n", MapStem, fname);
  298.                   perror("xcal: mkdir ");
  299.                   fflush(stderr);
  300. ***************
  301. *** 499,505 ****
  302.       strcat(fname, cname);
  303.   
  304.       if ((fd = open(fname, O_WRONLY|O_TRUNC|O_CREAT, 0666)) < 0)
  305. !     {    XBell(XtDisplay(toplevel, 0));
  306.           fprintf(stderr, "xcal: Could not open %s/%s for writing.\n", MapStem, fname);
  307.           perror("xcal: open");
  308.           fflush(stderr);
  309. --- 499,505 ----
  310.       strcat(fname, cname);
  311.   
  312.       if ((fd = open(fname, O_WRONLY|O_TRUNC|O_CREAT, 0666)) < 0)
  313. !     {    XBell(XtDisplay(toplevel), 0);
  314.           fprintf(stderr, "xcal: Could not open %s/%s for writing.\n", MapStem, fname);
  315.           perror("xcal: open");
  316.           fflush(stderr);
  317. ***************
  318. *** 507,513 ****
  319.       }
  320.   
  321.       if (write(fd, contents, len) != len)
  322. !     {    XBell(XtDisplay(toplevel, 0));
  323.           fprintf(stderr, "xcal: Write error %s/%s file.\n", MapStem, fname);
  324.           perror("xcal: write");
  325.           fflush(stderr);
  326. --- 507,513 ----
  327.       }
  328.   
  329.       if (write(fd, contents, len) != len)
  330. !     {    XBell(XtDisplay(toplevel), 0);
  331.           fprintf(stderr, "xcal: Write error %s/%s file.\n", MapStem, fname);
  332.           perror("xcal: write");
  333.           fflush(stderr);
  334. ***************
  335. *** 765,771 ****
  336.       register MeWrap    *mw;
  337.       register Cardinal day;
  338.       extern    Widget    toplevel;
  339. !     Arg    args[2];
  340.       
  341.       mw = ed->ed_meWrap;
  342.       day = ed->ed_day;
  343. --- 765,771 ----
  344.       register MeWrap    *mw;
  345.       register Cardinal day;
  346.       extern    Widget    toplevel;
  347. !     Arg    args[3];
  348.       
  349.       mw = ed->ed_meWrap;
  350.       day = ed->ed_day;
  351. ***************
  352. *** 779,789 ****
  353.           XtFree(mw->mw_have[day]);
  354.       mw->mw_have[day] = XtMalloc(strlen(ed->ed_data)+1);
  355.       strcpy(mw->mw_have[day], ed->ed_data);
  356.       XtSetArg(args[0], XtNlabel, mw->mw_have[day]);
  357. !     
  358.       for (ins = mw->mw_list; ins; ins = ins->i_next)
  359. !         XtSetValues(ins->i_day_info[day], args, 1);
  360.       XtSetSensitive(ed->ed_save, False);
  361.   }
  362.   
  363. --- 779,797 ----
  364.           XtFree(mw->mw_have[day]);
  365.       mw->mw_have[day] = XtMalloc(strlen(ed->ed_data)+1);
  366.       strcpy(mw->mw_have[day], ed->ed_data);
  367.       XtSetArg(args[0], XtNlabel, mw->mw_have[day]);
  368. !     if (*mw->mw_have[day])
  369. !     {    XtSetArg(args[1], XtNforeground, appResources.marked.fg);
  370. !         XtSetArg(args[2], XtNbackground, appResources.marked.bg);
  371. !     }
  372.       for (ins = mw->mw_list; ins; ins = ins->i_next)
  373. !     {    if (*mw->mw_have[day] == '\0')
  374. !         {    XtSetArg(args[1], XtNforeground, ins->i_col.fg);
  375. !             XtSetArg(args[2], XtNbackground, ins->i_col.bg);
  376. !         }
  377. !         XtSetValues(ins->i_day_info[day], args, 3);
  378. !     }
  379.       XtSetSensitive(ed->ed_save, False);
  380.   }
  381.   
  382. *** xcal_strip.c~    Sat May  5 16:26:01 1990
  383. --- xcal_strip.c    Sat May  5 16:15:27 1990
  384. ***************
  385. *** 1,5 ****
  386.   #ifndef lint
  387. ! static char *sccsid = "@(#)xcal_strip.c    3.3 (Hillside Systems) 2/5/90";
  388.   static char *copyright = "@(#)Copyright 1989 Peter Collinson, Hillside Systems";
  389.   #endif  lint
  390.   /***
  391. --- 1,5 ----
  392.   #ifndef lint
  393. ! static char *sccsid = "@(#)xcal_strip.c    3.4 (Hillside Systems) 5/2/90";
  394.   static char *copyright = "@(#)Copyright 1989 Peter Collinson, Hillside Systems";
  395.   #endif  lint
  396.   /***
  397. ***************
  398. *** 164,169 ****
  399. --- 164,174 ----
  400.       XtSetArg(args[0], XtNwidth, &totalWidth);
  401.       XtGetValues(lw, args, 1);
  402.       XtDestroyWidget(lw);
  403. +     /*
  404. +      *    Width is affected by a resource value
  405. +      */
  406. +     if (appResources.minstripwidth && appResources.minstripwidth > totalWidth)
  407. +         totalWidth = appResources.minstripwidth;
  408.       /*
  409.        *    Now set the title bar should we need it
  410.        */
  411. *** /dev/null    Sat May  5 15:32:42 1990
  412. --- CHANGES    Sat May  5 16:15:31 1990
  413. ***************
  414. *** 0 ****
  415. --- 1,22 ----
  416. + Changes:    CHANGES    1.4    5/5/90
  417. + xcal_edit.c    Fix bug where colour mapping on days failed to change when
  418. +         data is deleted or added.
  419. + xcal.h/xcal.c/xcal_strip.c
  420. +         Add a new resource minStripWidth intended to allow
  421. +         users to widen the strip to some value which seems
  422. +         sensible. If zero the resource is unused.
  423. + XCal.ad        Add colour map from wade@cs.utk.edu
  424. + xcal_edit.c    Changes to XBell calls due to typo
  425. +         Steve Alexander, Software Technologies Group
  426. +         INTERACTIVE Systems Corporation, Naperville, IL
  427. +          ...!{sun,ico}!laidbak!stevea
  428. +         stevea@i88.isc.com
  429. + Xcal - Version 1.1 Issued to the net comp.sources.x. 
  430. +         xcal: Volume 7, Issue 1-2
  431.  
  432. dan
  433. ----------------------------------------------------
  434. O'Reilly && Associates   argv@sun.com / argv@ora.com
  435. Opinions expressed reflect those of the author only.
  436.